l = ['A', 'B', 'C', 'D', 'E']

print(l[0:3])
print(l[:3])
print(l[3:])
'''
['A', 'B', 'C']
['A', 'B', 'C']
['D', 'E']
'''

print(l[-2:])  # ['D', 'E']
print(l[:])  # ['A', 'B', 'C', 'D', 'E']
print(list(range(0, 19)))  # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
l2 = list(range(100))

print(l2[::10])  # [0, 10, 20, 30, 40, 50, 60, 70, 80, 90] 每10个取一个

print('ABCDEFGHIJKLMN'[0:5])  # ABCDE

print((1, 2, 3, 4, 5, 6)[0:3])  # (1, 2, 3)



